/* eslint-disable @typescript-eslint/no-var-requires */
const express = require('express')
const app = express()
const port = 9627

// 默认响应数据
const responseData = {
  body: [
    {
      classId: 328115608045719552,
      cnName: 'opopopo',
      code: 'opo',
      createTime: '2022-08-23 11:13:15',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'op',
      enName: 'opp',
      id: 352410432586166272,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-23 11:13:15',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 350220132750757888,
      cnName: 'yuyuyuy123',
      code: 'yu',
      createTime: '2022-08-19 13:38:09',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'yu',
      enName: 'yu',
      id: 350997350093729792,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-19 13:38:50',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 328115608045719552,
      cnName: 'oooooo123',
      code: 'ooo',
      createTime: '2022-08-18 17:50:38',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'oo',
      enName: 'oo',
      id: 350698501731037184,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-18 17:50:48',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 328115608045719552,
      cnName: 'sdasdasdas',
      code: 'sdad',
      createTime: '2022-08-18 17:31:44',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'asad',
      enName: 'asd123',
      id: 350693744115232768,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-18 17:31:44',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 350220132750757888,
      cnName: 'erere',
      code: 'fdsfsf',
      createTime: '2022-08-17 16:32:17',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'er',
      enName: 'e456',
      id: 350316393563172864,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-18 17:35:25',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 327842123790704640,
      cnName: '中文001',
      code: 'abcd',
      createTime: '2022-08-16 16:01:19',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'en001',
      enName: 'english',
      id: 349946213917560832,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-29 14:35:04',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 1,
      cnName: '单元测试0a246910-151b-49a9-a7e5-7c7b9f4abdb4',
      code: '备注单元测试',
      createTime: '2022-08-11 15:16:55',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'junitbbaa7e4b-67c9-4191-9ee9-d7621f4c6710',
      enName: 'junit9901b78a-b9f2-4fe4-9631-f06762b227ad',
      id: 348123101209608192,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-11 15:16:55',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 327842123790704640,
      cnName: 'cnooo',
      code: 'oooo',
      createTime: '2022-08-10 10:47:48',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'enabbroo',
      enName: 'enoo',
      id: 347692989092433920,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-08-25 10:27:17',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    },
    {
      classId: 327842123790704640,
      cnName: 'asd',
      code: 'asd',
      createTime: '2022-07-13 09:46:03',
      createUserId: 322467180728889344,
      createUserName: 'security',
      enAbbr: 'dasd',
      enName: 'asd',
      id: 337530586582564864,
      isDel: 0,
      tenantId: 1012009,
      updateTime: '2022-07-13 09:46:03',
      updateUserId: 322467180728889344,
      updateUserName: 'security'
    },
    {
      classId: 327842123790704640,
      cnName: '度量单位001',
      code: 'code001',
      createTime: '2022-06-21 08:48:53',
      createUserId: 329276692417634304,
      createUserName: 'admin01',
      enAbbr: 'enAbbr',
      enName: 'enName',
      id: 329543667153391616,
      isDel: 0,
      tenantId: 700002,
      updateTime: '2022-06-21 08:48:53',
      updateUserId: 329276692417634304,
      updateUserName: 'admin01'
    },
    {
      classId: 327842123790704640,
      cnName: 'asdas',
      code: 'asdadasd',
      createTime: '2022-06-17 10:16:40',
      createUserId: 321955149168136192,
      createUserName: 'admin',
      enAbbr: 'sdas',
      enName: 'asd',
      id: 328116209496330240,
      isDel: 0,
      tenantId: 700000,
      updateTime: '2022-06-17 10:16:40',
      updateUserId: 321955149168136192,
      updateUserName: 'admin'
    },
    {
      classId: 327842123790704640,
      cnName: '度量单位002',
      code: 'code002',
      createTime: '2022-06-16 16:08:27',
      createUserId: 321955149168136192,
      createUserName: 'admin',
      enAbbr: 'en001',
      enName: 'enname002',
      id: 327842350094376960,
      isDel: 0,
      tenantId: 700000,
      updateTime: '2022-06-16 16:08:46',
      updateUserId: 321955149168136192,
      updateUserName: 'admin'
    },
    {
      classId: 327393223158292480,
      cnName: 'asdaasd',
      code: 'asd',
      createTime: '2022-06-15 10:24:31',
      createUserId: 666,
      createUserName: 'TestAccount',
      enAbbr: 'adas',
      enName: 'asd',
      id: 327393409406361600,
      isDel: 0,
      tenantId: 300002,
      updateTime: '2022-06-15 10:24:31',
      updateUserId: 666,
      updateUserName: 'TestAccount'
    }
  ],
  head: {
    code: 100000,
    error: '',
    msg: '成功'
  },
  timestamp: '2022-08-30 15:13:31'
}

app.get('/api/iot/options', (req, res) => {
  res.send(responseData)
})

app.post('/api/iot/postoptions', (req, res) => {
  res.send(responseData)
})

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})
